<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<script type="text/javascript" src="/fuman/js/report.js"></script>
<title>magento赞助</title>
<body class="withvernav">
<div class="bodywrapper"> {{include file='/public/leftmenu.tpl'}}
  <div class="centercontent">
    <div class="pageheader notab">
      <h1 class="pagetitle">magento赞助</h1>
       <div class="menulist">
                <ul class="profile_summary">
                    <li> <a href="ajaxbutton?op=successdata&type=0"  ><span>统计转化数据</span></a></li>
                    <li> <a href="ajaxbutton?op=creatsponsor&type=0"  ><span>创建新赞助</span></a></li>         
                </ul>
            </div>
    <form class="stdform stdform2" method="get" id="search" action="/magento/ajaxbutton">

      <div class="tableoptions">
      <input type="hidden" name="op" value="sponsorsearch">
      <span>条件</span>
      <select name="where" id="where"  class="selection select2_group" style="width:100px;">
              <option value="*" {{if "*"==$where}} selected{{/if}}>--请选择--</option>
              <option value="ms_user" {{if "ms_user"==$where}} selected{{/if}}>创建人</option>
              <option value="ms_object_email" {{if "ms_object_email"==$where}} selected{{/if}}>顾客邮箱</option>
              <option value="ms_object_name" {{if "ms_object_name"==$where}} selected{{/if}}>顾客姓名</option> 
              <option value="ms_social_media_url" {{if "ms_social_media_url"==$where}} selected{{/if}}>社交媒体地址</option>
              <option value="ms_object_address" {{if "ms_object_address"==$where}} selected{{/if}}>顾客地址</option>
              <option value="ms_object_city" {{if "ms_object_city"==$where}} selected{{/if}}>顾客城市</option>
              <option value="ms_object_country" {{if "ms_object_country"==$where}} selected{{/if}}>顾客国家</option>
              <option value="ms_object_post_code" {{if "ms_object_post_code"==$where}} selected{{/if}}>顾客邮编</option>
                    
        </select>
       <input type="text" name="value" id="kw" class="width200" value="{{$value}}" placeholder="关键词" />
&nbsp;
<span>类型</span>
<select name="mstype" id="mstype"  class="selection select2_group" style="width:100px;" >
             <option value="*" {{if "*"==$mstype}} selected{{/if}}>--请选择--</option>
             <option value="1" {{if "1"==$mstype}} selected{{/if}}>付费广告</option>
             <option value="2" {{if "2"==$mstype}} selected{{/if}}>赞助衣服</option>
             <option value="3" {{if "3"==$mstype}} selected{{/if}}>赠送礼物</option>
             <option value="4" {{if "4"==$mstype}} selected{{/if}}>工作外包</option>
</select>
<span>目的</span>
<select name="purpose" id="purpose"  class="selection select2_group" style="width:100px;" >
             <option value="*" {{if "*"==$purpose}} selected{{/if}}>--请选择--</option>
             <option value="1" {{if "1"==$purpose}} selected{{/if}}>文字连接</option>
             <option value="2" {{if "2"==$purpose}} selected{{/if}}>banner广告</option>
             <option value="3" {{if "3"==$purpose}} selected{{/if}}>博客网站宣传</option>
             <option value="4" {{if "4"==$purpose}} selected{{/if}}>社交媒体宣传</option>
             <option value="5" {{if "5"==$purpose}} selected{{/if}}>文章撰写</option>
             <option value="6" {{if "6"==$purpose}} selected{{/if}}>模特返图</option>
        </select>
        <span>创建时间</span>
           <input type="text"  name="starttime" value="{{$starttime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" /> - <input type="text"  name="endtime" value="{{$endtime}} " onClick="WdatePicker({dateFmt:'yyyy-MM-dd '})" class="width100 hasDatepicker" />
        <span>状态</span>
        <select name="ms_status" id="ms_status"  class="selection select2_group" style="width:100px;">
          <option value="*" {{if "*"==$ms_status}} selected{{/if}}>--请选择--</option>
          <option value="1" {{if "1"==$ms_status}} selected{{/if}}>新赞助</option>
          <option value="2" {{if "2"==$ms_status}} selected{{/if}}>已审批</option>
          <option value="3" {{if "3"==$ms_status}} selected{{/if}}>已完成</option>
        </select>
        <button class="btn btn-primary" id="searchbtn">Search</button>
        <span>搜索数量总计为{{$sum}}</span>
        
      </div>
      
    
    </form>
<div style="clear: both"></div>
<div class="page">
共计{{$pages}}页
<a href="{{$pageurl}}&page=1">首页</a>
{{if $lastpage > $zero}}
<a href="{{$pageurl}}&page={{$lastpage}}">上一页</a>
{{/if}}
{{foreach from=$pg item=li key=key}}
<a href="{{$pageurl}}&page={{$li}}">{{$li}}</a>
{{/foreach}}
{{if $nextpage <= $pages}}
<a href="{{$pageurl}}&page={{$nextpage}}">下一页</a>
{{/if}}
<a href="{{$pageurl}}&page={{$pages}}">末页</a>
<a  href="javascript:exportExl();">导出csv</a>
<a href="javascript:void(0)" onClick="addincome()">赞助数据导入</a>
</div>
</div>
   <!--搜索栏结束-->
<table cellpadding="0" cellspacing="0" border="0" class="stdtable" style="table-layout: fixed;">
<thead>
  <tr class="lbbt">
    <td width="3%"  bgcolor="#FEFFF1"><a onClick="allSelect('ppid[]')">全选</a></td>
    <td width="8%" bgcolor="#FEFFF1">ID</td>
    <td width="8%" bgcolor="#FEFFF1">赞助目的/赞助类型</td>
    <td width="8%" bgcolor="#FEFFF1">金额/状态</td>
    <td width="10%" bgcolor="#FEFFF1">商品/订单编号</td>
    <td width="10%" bgcolor="#FEFFF1">商品名称</td>
    <td width="10%"  bgcolor="#FEFFF1">客户姓名</td>
    <td width="10%" bgcolor="#FEFFF1">客户邮箱</td>
    <td width="5%" bgcolor="#FEFFF1">创建人</td>
    <td  bgcolor="#FEFFF1">创建时间</td>
    <td  bgcolor="#FEFFF1">缩略图</td>
    <td width="10%" bgcolor="#FEFFF1" >选择</td>
  </tr>
</thead>
<tbody >

{{foreach from=$sponsorlist item=li key=key}}
  <tr  style="cursor:pointer;">
    <td >
        <input name="ppid[]" type="checkbox" class="none" id="ppid[]" value="{{$li.wish_id}}" />
    </td>
     <td>{{$li.ms_id}}</td>
     <td>
    {{if 1==$li.ms_purpose}}文字连接{{/if}}
    {{if 2==$li.ms_purpose}}banner广告{{/if}}
    {{if 3==$li.ms_purpose}}博客网站宣传{{/if}}
    {{if 4==$li.ms_purpose}}社交媒体宣传{{/if}}
    {{if 5==$li.ms_purpose}}文章撰写{{/if}}
    {{if 6==$li.ms_purpose}}模特返图{{/if}}
     <br/>
    {{if 1==$li.ms_type}}付费广告{{/if}}
    {{if 2==$li.ms_type}}赞助衣服{{/if}}
    {{if 3==$li.ms_type}}赠送礼物{{/if}}
    {{if 4==$li.ms_type}}工作外包{{/if}}

     </td>
     <td>{{$li.ms_object_money}}{{$li.ms_object_money_sign}}<br/>
    {{if 1==$li.ms_status}}新赞助{{/if}}
    {{if 2==$li.ms_status}}已审核{{/if}}
    {{if 3==$li.ms_status}}已完成{{/if}}
     </td>
    <td>{{$li.ms_product_info}}<br/><a href="../orderlist/editorder?order_id={{$li.order_id}}" target="_blank">{{$li.order_sn}}</a></td>
    <td>{{$li.ms_product_china_name}}</td>
    <td>
       {{$li.ms_object_name}}
   </td>
    <td valign="middle">{{$li.ms_object_email}}</td>
   
    <td class="cz">
        {{$li.ms_user}}
    </td>
    <td>{{$li.ms_creat_time}}</td>
    <td>
    {{foreach from=$li.ms_img_data item=imgli key=imgkey}}
    <a href="../{{$imgli.2}}" target="_blank"><img style="width: 45px;height: 45px;" src='{{$imgli.3}}'></a>
    {{/foreach}}
    </td>
    <td class="cz"><a href="ajaxbutton?op=creatsponsor&type=1&id={{$li.ms_id}}&rand={{$rand}}" target="_blank"><button>编辑</button></a><button onclick="delect({{$li.ms_id}})">删除</button></td>
  </tr>
{{/foreach}}
</tbody>

</table>









     </div>
 </div>

 

<!-- 模态框（Modal）添加商品图片 -->
<form action="/magento/ajaxbutton?op=upincomecsv" enctype="multipart/form-data"  method="post" name="otherform" id="otherform" >
<input type="hidden" name="ms_id" id="ms_id">
  <div class="modal fade" id="addattributeform" tabindex="-1" role="dialog" aria-labelledby="returnaddattributeform" aria-hidden="true">
    <div class="modal-dialog" style="width:740px;">
      <div class="modal-content">
        <div class="modal-header">
          <button type="button" class="close" data-dismiss="modal" 
               aria-hidden="true">× </button>
          <h4 class="modal-title" id="returnaddattributeform"> 上传赞助数据</h4>
        </div>
        <div class="modal-body">
          <table width="100%" border="0" cellspacing="0" cellpadding="0">
            <tr>
              <td>上传： </td>
              <td align="left"><input type="file" name="userfile" id="userfile1" /></td>
            </tr>
            <tr>
              <td>货币单位</td>
              <td>          
              <select name="ms_income_currency" id="ms_income_currency">
                            <option value="USD" >USD</option>
                            <option value="EUR" >EUR</option>
                            <option value="GBP" >GBP</option>
                            <option value="US" >US</option>
                            <option value="AU" >AU</option>                 
                            <option value="AUD" >AUD</option>
                            <option value="CAD">CAD</option>
                            <option value="JPY" >JPY</option>
                            <option value="MYR" >MYR</option>
                            <option value="SGD" >SGD</option>
                            <option value="THD" >THD</option>
                            <option value="IDR" >IDR</option>
                            <option value="PHP" >PHP</option>
                            <option value="RMB" >RMB</option>
                            </select>
            </td>
            </tr>
            <tr>
              <td>输入时间段</td>
              <td>
              <input type="text" name="timedata" id="timedata" class="width200" placeholder="请输入时间段" />
              </td>
            </tr>
            <tr>
              <td>备注：</td>
              <td>目前仅 USD 测试完成，其它货币暂无数据测试，如果需要其它货币导入，请联系技术。</td>
            </tr>
            <tbody id="fileinput"></tbody>
          
          </table>
          <div class="modal-footer">
            <button type="button" class="btn btn-default" 
               data-dismiss="modal"> 关闭 </button>
            <button type="submit" class="submit radius2" > 提交 </button>
          </div>
        </div>
        <!-- /.modal-content --> 
      </div>
      <!-- /.modal-dialog --> 
    </div>
  </div>
</form>
<!-- 模态框（Modal）添加商品图片 -->





<script type="text/javascript">

function delect(id){
$.post("/magento/ajaxbutton?op=sponsordelect",{id:id},
  function(data){
     document.location.href = data;
  }
  );

}

function addincome()
{
     $('#addattributeform').modal('show');
}
</script>







</body>
</html>